﻿@model NBlog.Web.Application.LayoutModel
<!doctype html>
<html lang="en" class="no-js">
<head>
	<meta charset="utf-8">
	<!--[if IE]><![endif]-->

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>@(ViewBag.Title ?? Model.Base.SiteTitle)</title>
    <meta name="description" content="@Model.Base.SiteMetaDescription">
	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">

    <link href="@Url.Action("Index", "Feed")" rel="alternate" type="application/rss+xml" title="@Model.Base.SiteTitle" />

	<link rel="shortcut icon" href="@Url.Content("~/favicon.ico")">
	
    <link rel="Stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css">
    <link rel="Stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/smoothness/jquery-ui.css">
    <link rel="Stylesheet" href="@Url.Action("Css", "Script")">

	<script src="@Url.Content("~/resources/scripts/modernizr-1.5.min.js")"></script>

</head>
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <body class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <body class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <body class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->

<div id="container">
	<header>
		<div id="site">
            <a href="@Url.Action("Index", "Home")">
			    <div id="site-name">
				    @Model.Base.SiteHeading
			    </div>
			    <div id="tag-line">@Model.Base.SiteTagline</div>
            </a>
		</div>

		<div id="topbar">
			<div id="links" class="text-links">
                @(Model.Base.IsAuthenticated ? Html.Safe("<strong>" + Model.Base.FriendlyUsername + "</strong> |") : Html.Blank())
                @TwitterLink(@Model.Base.TwitterUsername)
                @Html.ActionLink("RSS", "Index", "Feed") |
                @Html.ActionLink("Contact", "Index", "Contact") |
				@(Model.Base.IsAuthenticated ? Html.ActionLink("Sign Out", "Logout", "Authentication") : Html.ActionLink("Sign In", "Login", "Authentication"))
			</div>
			<div id="search">
				<form action="@Url.Action("Index", "Search")">
					<input type="text" class="box" name="q" />
				</form>
			</div>
		</div>
	</header>
    
    <div id="main">
            <div class="crossbar text-links">
        @if (IsSectionDefined("Crossbar"))
        {
            @RenderSection("Crossbar", required: false)
        }
        else
        {
            @Html.Safe(Model.Base.Crossbar)
        }
            </div>
	    @RenderBody()
    </div>	

	<footer class="text-links">
        Powered by <a href="http://nblog.codeplex.com/">NBlog</a>
	</footer>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>    !window.jQuery && document.write('<script src="/resources/scripts/jquery-1.4.4.min.js"><\/script>')</script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script src="@Url.Action("JavaScript", "Script")"></script>

@RenderSection("Scripts", required: false)

<script>
    $(function () {
        $.datepicker.setDefaults({
            dateFormat: 'dd M yy',
            changeMonth: true,
            changeYear: true,
            constrainInput: true,
            currentText: 'Today',
            showAnim: 'slide',
            showButtonPanel: true

        });
        $("#search .box").watermark("search");
        $("input:submit, input:button, a.button, button").button();
        var a = $("pre:has(code)").addClass("prettyprint");
        prettyPrint();
    });
</script>

<!--[if lt IE 7 ]>
<script src="/resources/scripts/js/dd_belatedpng.js?v=1"></script>
<![endif]-->

@*<script src="/resources/scripts/profiling/yahoo-profiling.min.js?v=1"></script>
<script src="/resources/scripts/profiling/config.js?v=1"></script>*@

@if (!string.IsNullOrWhiteSpace(Model.Base.GoogleAnalyticsId))
{
<script>
    var _gaq = [['_setAccount', '@Model.Base.GoogleAnalyticsId'], ['_trackPageview']];
    (function (d, t) {
        var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
        g.async = true; g.src = '//www.google-analytics.com/ga.js'; s.parentNode.insertBefore(g, s);
    })(document, 'script');
</script>
}
 
</body>
</html>

@helper TwitterLink(string twitterUsername) {
    if (!string.IsNullOrWhiteSpace(twitterUsername))
    {
         <a href="http://twitter.com/@twitterUsername" target="_blank">Twitter</a> <text>|</text> 
    }
}